package com.itheima.apidemo;

import java.math.BigDecimal;

public class Demo06 {

    public static void main(String[] args) {
     /*   double d1=10.55;
        double  d2=3.1;
        //进制的转换
        System.out.println(d1-d2);*/
        BigDecimal bd1 = new BigDecimal(10.5);
        BigDecimal bd2 = new BigDecimal("3.1");
        System.out.println(bd1);
        System.out.println(bd2);

        BigDecimal add = bd1.add(bd2);
        System.out.println(add);
        BigDecimal subtract = bd1.subtract(bd2);
        System.out.println(subtract);
        System.out.println(bd1.multiply(bd2));
        System.out.println(bd1.divide(bd2));

    }
}
